package com.xiumu.bean.mapstruct;

import com.xiumu.bean.transform.dto.UserDTO;
import com.xiumu.bean.transform.dto.UserDTOPlus;
import com.xiumu.bean.transform.pojo.VblogUser;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @author xiumu
 * @date 2021年07月02日 21:48
 */
@Mapper
public interface BeanCopyUtil {

    BeanCopyUtil INSTANCE = Mappers.getMapper(BeanCopyUtil.class);

    UserDTO userToUserDTO(VblogUser user);


    @Mapping(target = "avatar", source = "userface")
    @Mapping(target = "createTime", source = "regTime")
    UserDTOPlus userToUserPlus(VblogUser user);
}
